<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>搜索结果</title>
    <link rel="stylesheet" href="assets/css/style.css">
    <link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.css">
    <link rel="stylesheet" href="assets/vendors/nprogress/nprogress.css">
       <style>
      #aside{
        position: fixed !important;
        top: 0 !important;
      }
    </style>
</head>

<body>
      <header id="headerNavBar">
      <div id="containerBar">
        <a class="logoImg" href="index.html"><img src="./assets/img/logo.png" alt="" /></a>
        <div id="linkBox">
          <span><a href="https://eshin.co.jp/">Eshinホーム</a></span>
          <span><a href="https://esna-web.com/">ESNAホーム</a></span>
          <span><a href="http://47.101.64.135/">Vue-OnLine</a></span>
          <span
            ><input id="inputSearch" type="text" /><i class="searchNav fa fa-search"></i
          ></span>
        </div>
        <div id="loginLink"><a href="/admin">登录</a></div>
      </div>
    </header>
    <div class="wrapper">
        <div class="topnav">
            <ul class="navBox">

            </ul>
        </div>
        <div class="header">
            <h1 class="logo">
                <a href="index.html"><img src="assets/img/logo.png" alt=""></a>
            </h1>
             <div class="search">
                <form>
                    <input type="text" class="keys" placeholder="输入关键字" id="searchcont1">
                    <input type="submit" class="btn" value="搜索" id="searchbtn1">
                </form>
            </div>
            <ul class="nav navBox">

            </ul>
           
        </div>
        <div class="aside" id="aside">
            <div class="widgets">
                <h4>博文搜索</h4>
                <div class="body search">
                    <form>
                        <input type="text" class="keys" placeholder="输入关键字" id="searchcont2">
                        <input type="submit" class="btn" value="搜索" id="searchbtn2">
                    </form>
                </div>
            </div>
            <div class="widgets">
                <h4>外链地址</h4>
                <ul class="body random" id="randomBox">

                </ul>
            </div>
            <div class="widgets">
                <h4>最新评论，欢迎留言！</h4>
                <ul class="body discuz" id="commentsBox">

                </ul>
            </div>
        </div>
        <div class="content">
            <div class="panel new">
                <h3 id="categoryTitle">搜索结果</h3>
                <div id="searchBox">

                </div>
            </div>
        </div>
        <div class="footer">
            <p>© 本站由个人独立制作 主要用于技术学习笔记存储</p>
        </div>
    </div>
    <script src="assets/vendors/jquery/jquery.js"></script>
    <script src="assets/vendors/nprogress/nprogress.js"></script>
    <script src="./assets/vendors/art-template/template-web.js"></script>
    <script src="./assets/js/public.js"></script>
    <script src="./assets/js/search.js"></script>
    <!-- 搜索结果展示模板 -->
    <script type="text/html" id="searchTpl">
        {{if data.length !== 0 }} {{each data}}
        <div class="entry">
            <div class="head">
                <a href="detail.html?id={{$value._id}}">{{$value.title}}</a>
            </div>
            <div class="main">
                <p class="info" style="line-height: 35px;">{{$value.author.nickName}} 发表于 {{$imports.formateDate($value.createAt)}}</p>
                <p class="extra">
                    <i class="fa fa-book"></i><span class="reading">阅读({{$value.meta.views}})</span>
                    <i class="fa fa-comments"></i><span class="comment">评论({{$value.meta.comments}})</span>
                    <a href="detail.html?id={{$value._id}}" class="like">
                        <i class="fa fa-thumbs-up"></i>
                        <span>赞({{$value.meta.likes}})</span>
                    </a>
                    <a href="detail.html?id={{$value._id}}" class="tags">
        分类：<span>{{$value.category.title}}</span>
      </a>
                </p>
                <a href="detail.html?id={{$value._id}}" class="thumb">
                    <img src="{{$value.thumbnail}}" alt="">
                </a>
            </div>
        </div>
        {{/each}} {{else}}
        <h2>未找到相应内容</h2>
        {{/if}}
    </script>
    <script>
      var btn1 = document.getElementById("searchbtn1");
      var cont1 = document.getElementById("searchcont1");
      var btn2 = document.getElementById("searchbtn2");
      var cont2 = document.getElementById("searchcont2");

      btn1.onclick = function (e) {
        if (cont1.value.trim() == "") {
          e.preventDefault();
          alert("请输入搜索内容");
          return;
        }
      };
      btn2.onclick = function (e) {
        if (cont2.value.trim() == "") {
          e.preventDefault();
          alert("请输入搜索内容");
          return;
        }
      };
    </script>
</body>

</html>